<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: contracts/eoslib/vector.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html">eoslib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">vector.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="vector_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="utility_8hpp.html">eoslib/utility.hpp</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="memory_8hpp.html">eoslib/memory.hpp</a>&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stdlib_8hpp.html">eoslib/stdlib.hpp</a>&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeosio.html">eosio</a> {</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html">   12</a></span>&#160;   <span class="keyword">class </span><a class="code" href="classeosio_1_1vector.html">vector</a> {</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;      <span class="keyword">public</span>:</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a7af035f852182cf3a9b46c459d61538f">   14</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#a7af035f852182cf3a9b46c459d61538f">vector</a>(){}</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a217eb9aa0a597d37ab873193d0a83ed5">   16</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#a217eb9aa0a597d37ab873193d0a83ed5">vector</a>( <span class="keywordtype">size_t</span> s, <span class="keyword">const</span> T&amp; value ) {</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;            <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( s );</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;            <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt; s; ++i )</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;               <a class="code" href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">emplace_back</a>( value );</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;         }</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#ab940de37380d9e68123958dcc5d38fcb">   22</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#ab940de37380d9e68123958dcc5d38fcb">vector</a>( <span class="keyword">const</span> <a class="code" href="classeosio_1_1vector.html">vector</a>&amp; copy ) {</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;            <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( copy.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>() );</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;            <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt; copy.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>(); ++i ) {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;               <a class="code" href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">emplace_back</a>( copy[i] );</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;            }</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;         }</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a01cef82b778bad40fb89714dce4b2f48">   29</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#a01cef82b778bad40fb89714dce4b2f48">vector</a>( <a class="code" href="classeosio_1_1vector.html">vector</a>&amp;&amp; mv ) {</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;            _data  = mv._data;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;            _size  = mv._size;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;            _capacity = mv._capacity;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;            mv._data = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            mv._size = 0;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            mv._capacity = 0;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;         }</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a8d732a6583e38f78ebdc361895ecfc53">   38</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#a8d732a6583e38f78ebdc361895ecfc53">vector</a>( <a class="code" href="classstd_1_1initializer__list.html">std::initializer_list&lt;T&gt;</a> <a class="code" href="namespaceeosiosystem.html#a3ea5c4b8e36e422e6dd7f2e60ffd6fd4">init</a> ) {</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            <a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>(0);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;            <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( init.<a class="code" href="classstd_1_1initializer__list.html#aee0702b77d3afc3964b6dff4bf09dc05">size</a>() );</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            <span class="keywordflow">for</span>( <span class="keyword">auto</span> itr = init.<a class="code" href="classstd_1_1initializer__list.html#ac763ad3c10144402b0c8d8f9995dcc47">begin</a>(); itr != init.<a class="code" href="classstd_1_1initializer__list.html#abd1d0fd2c35074ce0b51ba1c39173ee0">end</a>(); itr++ ) {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;               <a class="code" href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">emplace_back</a>( *itr );</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            }</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;         }</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a3b871c98d76a1a13b16f4fc5996f2c60">   48</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html#a3b871c98d76a1a13b16f4fc5996f2c60">~vector</a>() {</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt; _size; ++i )</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;               _data[i].~T();</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            <a class="code" href="group__memorycppapi.html#gadc937e4380b5ab7212b4b603ccc516c5">free</a>( _data );</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            _data     = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            _size     = 0;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            _capacity = 0;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;         }</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#ab2821de5f5b91b9855597377d0e49634">   57</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html">vector</a>&amp; <a class="code" href="classeosio_1_1vector.html#ab2821de5f5b91b9855597377d0e49634">operator = </a>( <span class="keyword">const</span> <a class="code" href="classeosio_1_1vector.html">vector</a>&amp; copy ) {</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <span class="keywordflow">if</span>( <span class="keyword">this</span> != &amp;copy ) {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;               <a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>(0);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;               <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( copy.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>() );</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;               <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt; copy.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>(); ++i ) {</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                  <span class="keyword">new</span> (&amp;_data[i]) T( copy[i] );</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;               }</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;               _size = copy.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>();</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            }</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;         }</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a546a28337a97cbeac4a5c80f0fa1b177">   70</a></span>&#160;         <a class="code" href="classeosio_1_1vector.html">vector</a>&amp; <a class="code" href="classeosio_1_1vector.html#ab2821de5f5b91b9855597377d0e49634">operator = </a>( <a class="code" href="classeosio_1_1vector.html">vector</a>&amp;&amp; mv ) {</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>( 0 );</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            _data  = mv._data;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            _size  = mv._size;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            _capacity = mv._capacity;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            mv._data = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            mv._size = 0;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            mv._capacity = 0;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;         }</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a548f60faff31850ba00c25bd5c1ceeaa">   82</a></span>&#160;         T&amp;       <a class="code" href="classeosio_1_1vector.html#a548f60faff31850ba00c25bd5c1ceeaa">operator[]</a>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> index )      { <span class="keywordflow">return</span> _data[index]; }</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a44e8c32a4aac80915c4eb9aedd9f51e7">   83</a></span>&#160;         <span class="keyword">const</span> T&amp; <a class="code" href="classeosio_1_1vector.html#a44e8c32a4aac80915c4eb9aedd9f51e7">operator[]</a>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> index )<span class="keyword">const </span>{ <span class="keywordflow">return</span> _data[index]; }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#adfbf8b5fa74937488043cef7079121de">   85</a></span>&#160;         T* <a class="code" href="classeosio_1_1vector.html#adfbf8b5fa74937488043cef7079121de">begin</a>()              { <span class="keywordflow">return</span> _data; }</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a21ec8a9216f6d5318bdcd68e5d82882d">   86</a></span>&#160;         T* <a class="code" href="classeosio_1_1vector.html#a21ec8a9216f6d5318bdcd68e5d82882d">end</a>()                { <span class="keywordflow">return</span> _data + _size; }</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a75479f7c3bfee0e255f6103fd2977cbb">   87</a></span>&#160;         <span class="keyword">const</span> T* <a class="code" href="classeosio_1_1vector.html#a75479f7c3bfee0e255f6103fd2977cbb">begin</a>()<span class="keyword">const   </span>{ <span class="keywordflow">return</span> _data; }</div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#afaf459c024304ac4143862fb0b6343d7">   88</a></span>&#160;         <span class="keyword">const</span> T* <a class="code" href="classeosio_1_1vector.html#afaf459c024304ac4143862fb0b6343d7">end</a>()<span class="keyword">const     </span>{ <span class="keywordflow">return</span> _data + _size; }</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a507aa9b38f52df26d8b740cc30379a08">   90</a></span>&#160;         <span class="keyword">const</span> T* <a class="code" href="classeosio_1_1vector.html#a507aa9b38f52df26d8b740cc30379a08">data</a>()<span class="keyword">const     </span>{ <span class="keywordflow">return</span> _data;     }</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a6f0acffffdc0a8291404a46175422919">   91</a></span>&#160;         T* <a class="code" href="classeosio_1_1vector.html#a6f0acffffdc0a8291404a46175422919">data</a>()                { <span class="keywordflow">return</span> _data;     }</div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">   92</a></span>&#160;         <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> <a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>()<span class="keyword">const     </span>{ <span class="keywordflow">return</span> _size;     }</div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a9b01c29671da10ccbf500814d6b7e68c">   93</a></span>&#160;         <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> <a class="code" href="classeosio_1_1vector.html#a9b01c29671da10ccbf500814d6b7e68c">capacity</a>()<span class="keyword">const </span>{ <span class="keywordflow">return</span> _capacity; }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a9347f7c2342abda34958369c03cba76f">   95</a></span>&#160;         <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1vector.html#a9347f7c2342abda34958369c03cba76f">push_back</a>( <span class="keyword">const</span> T&amp; value ) {</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            <span class="keywordflow">if</span>( _size == _capacity )</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;               <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( _size + 1 );</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            <span class="keyword">new</span> (&amp;_data[_size]) T( value );</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            ++_size;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;         }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;         <span class="keyword">template</span>&lt;<span class="keyword">typename</span>... Args&gt;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">  103</a></span>&#160;         <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">emplace_back</a>( Args&amp;&amp; ...value ) {</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            <span class="keywordflow">if</span>( _size == _capacity )</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;               <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( _size + 1 );</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;            <span class="keyword">new</span> (&amp;_data[_size]) T( forward&lt;Args&gt;(value)... );</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            ++_size;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;         }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">  110</a></span>&#160;         <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> new_size ) {</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( new_size );</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            <span class="keywordflow">if</span>( new_size &gt; _size ) </div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;               <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = _size; i &lt; new_size; ++i ) {</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                  <span class="keyword">new</span> (&amp;_data[i]) T();</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;               }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            } </div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( new_size &lt; _size ) </div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;            {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;               <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = new_size; i &lt; _size; ++i ) {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                  _data[i].~T();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;               }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            }</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            _size = new_size;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;         } </div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">  127</a></span>&#160;         <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">reserve</a>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> new_capacity ) {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            <span class="keywordflow">if</span>( new_capacity &gt; _capacity ) {</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;               T* new_data = (T*)<a class="code" href="group__memorycppapi.html#gac4387e5dad9585f885c0c0bf8d353739">malloc</a>( <span class="keyword">sizeof</span>(T) * new_capacity );</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;               <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt; _size; ++i ) {</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                  <span class="keyword">new</span> (new_data+i) T( <a class="code" href="namespaceeosio.html#af29f4c3b46ef396883a8ba57c534a808">move</a>( _data[i] ) );</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                  _data[i].~T();</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;               }</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;               <a class="code" href="group__memorycppapi.html#gadc937e4380b5ab7212b4b603ccc516c5">free</a>( _data );</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;               _data = new_data;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;               _capacity = new_capacity;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;         }</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;      <span class="keyword">private</span>:</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;         T*       _data     = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;         <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> _size     = 0;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;         <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> _capacity = 0;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;   }; </div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;}  </div><div class="ttc" id="namespaceeosio_html"><div class="ttname"><a href="namespaceeosio.html">eosio</a></div><div class="ttdoc">Used to forward declare raw functions. </div><div class="ttdef"><b>Definition:</b> account.hpp:12</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a21ec8a9216f6d5318bdcd68e5d82882d"><div class="ttname"><a href="classeosio_1_1vector.html#a21ec8a9216f6d5318bdcd68e5d82882d">eosio::vector::end</a></div><div class="ttdeci">T * end()</div><div class="ttdef"><b>Definition:</b> vector.hpp:86</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a8d732a6583e38f78ebdc361895ecfc53"><div class="ttname"><a href="classeosio_1_1vector.html#a8d732a6583e38f78ebdc361895ecfc53">eosio::vector::vector</a></div><div class="ttdeci">vector(std::initializer_list&lt; T &gt; init)</div><div class="ttdef"><b>Definition:</b> vector.hpp:38</div></div>
<div class="ttc" id="classstd_1_1initializer__list_html_abd1d0fd2c35074ce0b51ba1c39173ee0"><div class="ttname"><a href="classstd_1_1initializer__list.html#abd1d0fd2c35074ce0b51ba1c39173ee0">std::initializer_list::end</a></div><div class="ttdeci">constexpr const E * end() const noexcept</div><div class="ttdef"><b>Definition:</b> stdlib.hpp:28</div></div>
<div class="ttc" id="classeosio_1_1vector_html_ab2821de5f5b91b9855597377d0e49634"><div class="ttname"><a href="classeosio_1_1vector.html#ab2821de5f5b91b9855597377d0e49634">eosio::vector::operator=</a></div><div class="ttdeci">vector &amp; operator=(const vector &amp;copy)</div><div class="ttdef"><b>Definition:</b> vector.hpp:57</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a857bf0bac13794f1df2f5d25b5b5d5a8"><div class="ttname"><a href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">eosio::vector::size</a></div><div class="ttdeci">uint32_t size() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:92</div></div>
<div class="ttc" id="classeosio_1_1vector_html_afaf459c024304ac4143862fb0b6343d7"><div class="ttname"><a href="classeosio_1_1vector.html#afaf459c024304ac4143862fb0b6343d7">eosio::vector::end</a></div><div class="ttdeci">const T * end() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:88</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a9b01c29671da10ccbf500814d6b7e68c"><div class="ttname"><a href="classeosio_1_1vector.html#a9b01c29671da10ccbf500814d6b7e68c">eosio::vector::capacity</a></div><div class="ttdeci">uint32_t capacity() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:93</div></div>
<div class="ttc" id="group__memorycppapi_html_gadc937e4380b5ab7212b4b603ccc516c5"><div class="ttname"><a href="group__memorycppapi.html#gadc937e4380b5ab7212b4b603ccc516c5">eosio::free</a></div><div class="ttdeci">void free(void *ptr)</div><div class="ttdoc">Free a block of memory. </div><div class="ttdef"><b>Definition:</b> memory.hpp:529</div></div>
<div class="ttc" id="classeosio_1_1vector_html_adfbf8b5fa74937488043cef7079121de"><div class="ttname"><a href="classeosio_1_1vector.html#adfbf8b5fa74937488043cef7079121de">eosio::vector::begin</a></div><div class="ttdeci">T * begin()</div><div class="ttdef"><b>Definition:</b> vector.hpp:85</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a217eb9aa0a597d37ab873193d0a83ed5"><div class="ttname"><a href="classeosio_1_1vector.html#a217eb9aa0a597d37ab873193d0a83ed5">eosio::vector::vector</a></div><div class="ttdeci">vector(size_t s, const T &amp;value)</div><div class="ttdef"><b>Definition:</b> vector.hpp:16</div></div>
<div class="ttc" id="group__types_html_ga06896e8c53f721507066c079052171f8"><div class="ttname"><a href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a></div><div class="ttdeci">unsigned long uint32_t</div><div class="ttdef"><b>Definition:</b> types.h:19</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a7af035f852182cf3a9b46c459d61538f"><div class="ttname"><a href="classeosio_1_1vector.html#a7af035f852182cf3a9b46c459d61538f">eosio::vector::vector</a></div><div class="ttdeci">vector()</div><div class="ttdef"><b>Definition:</b> vector.hpp:14</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a44e8c32a4aac80915c4eb9aedd9f51e7"><div class="ttname"><a href="classeosio_1_1vector.html#a44e8c32a4aac80915c4eb9aedd9f51e7">eosio::vector::operator[]</a></div><div class="ttdeci">const T &amp; operator[](uint32_t index) const</div><div class="ttdef"><b>Definition:</b> vector.hpp:83</div></div>
<div class="ttc" id="classstd_1_1initializer__list_html_ac763ad3c10144402b0c8d8f9995dcc47"><div class="ttname"><a href="classstd_1_1initializer__list.html#ac763ad3c10144402b0c8d8f9995dcc47">std::initializer_list::begin</a></div><div class="ttdeci">constexpr const E * begin() const noexcept</div><div class="ttdef"><b>Definition:</b> stdlib.hpp:25</div></div>
<div class="ttc" id="utility_8hpp_html"><div class="ttname"><a href="utility_8hpp.html">utility.hpp</a></div></div>
<div class="ttc" id="classstd_1_1initializer__list_html"><div class="ttname"><a href="classstd_1_1initializer__list.html">std::initializer_list</a></div><div class="ttdef"><b>Definition:</b> stdlib.hpp:13</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a507aa9b38f52df26d8b740cc30379a08"><div class="ttname"><a href="classeosio_1_1vector.html#a507aa9b38f52df26d8b740cc30379a08">eosio::vector::data</a></div><div class="ttdeci">const T * data() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:90</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a3b871c98d76a1a13b16f4fc5996f2c60"><div class="ttname"><a href="classeosio_1_1vector.html#a3b871c98d76a1a13b16f4fc5996f2c60">eosio::vector::~vector</a></div><div class="ttdeci">~vector()</div><div class="ttdef"><b>Definition:</b> vector.hpp:48</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a75479f7c3bfee0e255f6103fd2977cbb"><div class="ttname"><a href="classeosio_1_1vector.html#a75479f7c3bfee0e255f6103fd2977cbb">eosio::vector::begin</a></div><div class="ttdeci">const T * begin() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:87</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a548f60faff31850ba00c25bd5c1ceeaa"><div class="ttname"><a href="classeosio_1_1vector.html#a548f60faff31850ba00c25bd5c1ceeaa">eosio::vector::operator[]</a></div><div class="ttdeci">T &amp; operator[](uint32_t index)</div><div class="ttdef"><b>Definition:</b> vector.hpp:82</div></div>
<div class="ttc" id="classeosio_1_1vector_html"><div class="ttname"><a href="classeosio_1_1vector.html">eosio::vector</a></div><div class="ttdef"><b>Definition:</b> vector.hpp:12</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a40d08615fce535bad989bfc29b64bc27"><div class="ttname"><a href="classeosio_1_1vector.html#a40d08615fce535bad989bfc29b64bc27">eosio::vector::emplace_back</a></div><div class="ttdeci">void emplace_back(Args &amp;&amp;...value)</div><div class="ttdef"><b>Definition:</b> vector.hpp:103</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a01cef82b778bad40fb89714dce4b2f48"><div class="ttname"><a href="classeosio_1_1vector.html#a01cef82b778bad40fb89714dce4b2f48">eosio::vector::vector</a></div><div class="ttdeci">vector(vector &amp;&amp;mv)</div><div class="ttdef"><b>Definition:</b> vector.hpp:29</div></div>
<div class="ttc" id="stdlib_8hpp_html"><div class="ttname"><a href="stdlib_8hpp.html">stdlib.hpp</a></div></div>
<div class="ttc" id="classeosio_1_1vector_html_ab940de37380d9e68123958dcc5d38fcb"><div class="ttname"><a href="classeosio_1_1vector.html#ab940de37380d9e68123958dcc5d38fcb">eosio::vector::vector</a></div><div class="ttdeci">vector(const vector &amp;copy)</div><div class="ttdef"><b>Definition:</b> vector.hpp:22</div></div>
<div class="ttc" id="namespaceeosiosystem_html_a3ea5c4b8e36e422e6dd7f2e60ffd6fd4"><div class="ttname"><a href="namespaceeosiosystem.html#a3ea5c4b8e36e422e6dd7f2e60ffd6fd4">eosiosystem::init</a></div><div class="ttdeci">void init()</div><div class="ttdef"><b>Definition:</b> eosio.system.cpp:52</div></div>
<div class="ttc" id="classeosio_1_1vector_html_affd755e65937766d1d77e6c820efa69d"><div class="ttname"><a href="classeosio_1_1vector.html#affd755e65937766d1d77e6c820efa69d">eosio::vector::reserve</a></div><div class="ttdeci">void reserve(uint32_t new_capacity)</div><div class="ttdoc">resize </div><div class="ttdef"><b>Definition:</b> vector.hpp:127</div></div>
<div class="ttc" id="namespaceeosio_html_af29f4c3b46ef396883a8ba57c534a808"><div class="ttname"><a href="namespaceeosio.html#af29f4c3b46ef396883a8ba57c534a808">eosio::move</a></div><div class="ttdeci">remove_reference&lt; T &gt;::type &amp;&amp; move(T &amp;&amp;arg)</div><div class="ttdef"><b>Definition:</b> utility.hpp:10</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a6f0acffffdc0a8291404a46175422919"><div class="ttname"><a href="classeosio_1_1vector.html#a6f0acffffdc0a8291404a46175422919">eosio::vector::data</a></div><div class="ttdeci">T * data()</div><div class="ttdef"><b>Definition:</b> vector.hpp:91</div></div>
<div class="ttc" id="memory_8hpp_html"><div class="ttname"><a href="memory_8hpp.html">memory.hpp</a></div></div>
<div class="ttc" id="group__memorycppapi_html_gac4387e5dad9585f885c0c0bf8d353739"><div class="ttname"><a href="group__memorycppapi.html#gac4387e5dad9585f885c0c0bf8d353739">eosio::malloc</a></div><div class="ttdeci">void * malloc(uint32_t size)</div><div class="ttdoc">Allocate a block of memory. </div><div class="ttdef"><b>Definition:</b> memory.hpp:494</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a3028d9696b8e9e043d48c1985b5a228a"><div class="ttname"><a href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">eosio::vector::resize</a></div><div class="ttdeci">void resize(uint32_t new_size)</div><div class="ttdef"><b>Definition:</b> vector.hpp:110</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a9347f7c2342abda34958369c03cba76f"><div class="ttname"><a href="classeosio_1_1vector.html#a9347f7c2342abda34958369c03cba76f">eosio::vector::push_back</a></div><div class="ttdeci">void push_back(const T &amp;value)</div><div class="ttdef"><b>Definition:</b> vector.hpp:95</div></div>
<div class="ttc" id="classstd_1_1initializer__list_html_aee0702b77d3afc3964b6dff4bf09dc05"><div class="ttname"><a href="classstd_1_1initializer__list.html#aee0702b77d3afc3964b6dff4bf09dc05">std::initializer_list::size</a></div><div class="ttdeci">constexpr size_t size() const noexcept</div><div class="ttdef"><b>Definition:</b> stdlib.hpp:22</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
